#include <iostream>
using namespace std;

int main()
{
	int a = 0;
	cin >> a;
	if (a % 2 == 0 && a > 4 && a <= 12)
		cout << "1" << " ";
	else
		cout << "0" << " ";
	if (a % 2 == 0 || (a > 4 && a <= 12))
		cout << "1" << " ";
	else
		cout << "0" << " ";
	if ((a % 2 == 0) + (a > 4 && a <= 12) == 1)
		cout << "1" << " ";
	else
		cout << "0" << " ";
	if ((a % 2 == 0) + (a > 4 && a <= 12) == 0)
		cout << "1";
	else
		cout << "0";
	return 0;
}
